package com.scy.java.Test.Test03;

//顺序查找：挨个查看
//        要求：对数组元素的顺序没要求
public class Demo02 {
    public static void main(String[] args) {
        int[] arr = {-1,-65,-35,0,2,45,7,1,9,5,78,98};
        int index = 1;
        int t = 0;
        boolean isFald = false;
        for (int i = 0; i < arr.length; i++) {
            if (index == arr[i]){
                isFald = true;
                t = i ;
                break;
            }
        }

        if (!isFald){
            System.out.println("您查找的数不存在！");
        }else {
            System.out.println("您要查找的数在下标为："+t);
        }
    }
}
